package b.utils.test

import b.utils.entity.C流水号产生器

/**
  * 贲国称 于 2016/12/20 创建。
  */
object TryIdWorker extends App {
  def test(workerId: Int, dataCenterId: Int): Unit = {
    val worker = new C流水号产生器(workerId, dataCenterId, 0L)
    for (i <- 1 to 10) {
      val id = worker.nextId()
      println(s"id: $id")
    }
  }
  test(1, 1)
  test(2, 1)
  test(1, 2)
  println(s"max int: ${Int.MaxValue}")
  println(s"lg: ${Long.MaxValue}")
  println(s"lg: ${Long.MinValue}")
}